Add gratituous casts for the benefit of a language we aren't even written
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 24 Jun 2004 17:18:52 +0000 (17:18 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 24 Jun 2004 17:18:52 +0000 (17:18 +0000)
in...

gpsbabel/arcdist.c
gpsbabel/defs.h
gpsbabel/duplicate.c
gpsbabel/gpx.c
gpsbabel/netstumbler.c
gpsbabel/polygon.c
gpsbabel/position.c
gpsbabel/smplrout.c
gpsbabel/sort.c
gpsbabel/xcsv.c

index 6ee80ef96205420ae406e6848df22e5ff504cd80..7ee828099d12db2fb6b7f5be9302f99a846b3459 100644 (file)
@@ -91,10 +91,10 @@ arcdist_process(void)
                dist = (((dist * 180.0 * 60.0) / M_PI) * 1.1516);
 
                if ( waypointp->extra_data ) {
-                       ed = waypointp->extra_data;
+                       ed = (extra_data *) waypointp->extra_data;
                }
                else {
-                       ed = xcalloc(1, sizeof(*ed));
+                       ed = (extra_data *) xcalloc(1, sizeof(*ed));
                        ed->distance = BADVAL;
                }
                if ( ed->distance > dist ) {
@@ -112,7 +112,7 @@ arcdist_process(void)
 
        QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
                waypoint *wp = (waypoint *) elem;
-               ed = wp->extra_data;
+               ed = (extra_data *) wp->extra_data;
                wp->extra_data = NULL;
                if ( ed ) {
                    if ((ed->distance >= pos_dist) == (exclopt == NULL)) {
index 6a02fba50535cb1982a2ccbd5ee7176d46cbc90c..b6d36c20fdbaef793ff873912dd75ef0994e8e4b 100644 (file)
@@ -256,6 +256,7 @@ void route_add (waypoint *);
 void route_add_wpt(route_head *rte, waypoint *wpt);
 void route_del_wpt(route_head *rte, waypoint *wpt);
 void route_add_head(route_head *rte);
+void route_reverse(const route_head *rte_hd);
 void track_add_head(route_head *rte);
 void route_disp_all(route_hdr, route_trl, waypt_cb);
 void track_disp_all(route_hdr, route_trl, waypt_cb);
@@ -382,13 +383,13 @@ void xfree(void *mem);
 char *xstrdup(const char *s);
 char *xstrndup(const char *s, size_t n);
 char *xstrndupt(const char *s, size_t n);
-char *xstrappend(char *src, const char *new);
+char *xstrappend(char *src, const char *addon);
 #define xxcalloc(nmemb, size, file, line) xcalloc(nmemb, size)
 #define xxmalloc(size, file, line) xmalloc(size)
 #define xxrealloc(p, s, file, line) xrealloc(p,s)
 #define xxfree(mem, file, line) xfree(mem)
 #define xxstrdup(s, file, line) xstrdup(s)
-#define xxstrappend(src, new, file, line) xstrappend(src, new)
+#define xxstrappend(src, addon, file, line) xstrappend(src, addon)
 #else /* DEBUG_MEM */
 void *XCALLOC(size_t nmemb, size_t size, DEBUG_PARAMS );
 void *XMALLOC(size_t size, DEBUG_PARAMS );
@@ -397,7 +398,7 @@ void XFREE(void *mem, DEBUG_PARAMS );
 char *XSTRDUP(const char *s, DEBUG_PARAMS );
 char *XSTRNDUP(const char *src, size_t size, DEBUG_PARAMS );
 char *XSTRNDUPT(const char *src, size_t size, DEBUG_PARAMS );
-char *XSTRAPPEND(char *src, const char *new, DEBUG_PARAMS );
+char *XSTRAPPEND(char *src, const char *addon, DEBUG_PARAMS );
 void debug_mem_open();
 void debug_mem_output( char *format, ... );
 void debug_mem_close();
@@ -408,7 +409,7 @@ void debug_mem_close();
 #define xstrdup(s) XSTRDUP(s, __FILE__, __LINE__)
 #define xstrndup(s, z) XSTRNDUP(s, z, __FILE__, __LINE__)
 #define xstrndupt(s, z) XSTRNDUPT(s, z, __FILE__, __LINE__)
-#define xstrappend(src,new) XSTRAPPEND(src, new, __FILE__, __LINE__)
+#define xstrappend(src,addon) XSTRAPPEND(src, addon, __FILE__, __LINE__)
 #define xxcalloc XCALLOC
 #define xxmalloc XMALLOC
 #define xxrealloc XREALLOC
index 9fc23bea195e50264e30bbfc5ef06cf888e2f311..7f11fac9b74e0b89b68b616b411b31bdb5349071 100644 (file)
@@ -174,7 +174,7 @@ duplicate_process(void)
        queue *elem, *tmp;
        extern queue waypt_head;
 
-       htable = xmalloc(ct * sizeof(*htable));
+       htable = (wpt_ptr *) xmalloc(ct * sizeof(*htable));
        bh = htable;
 
        i = 0;
index 9b0fea6a380f08280da3572a34bfb05da1c183d1..7d70bcdedf7f13c9e4eecc08d92f0d4a9b7340b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Access GPX data files.
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002, 2003, 2004 Robert Lipe, robertlipe@usa.net
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index ef17d7715fcf3b321a046afcbcd6554f9a3ea72b..487fc0c48ff618fd194ec145283561be22f18ab9 100644 (file)
@@ -166,7 +166,7 @@ data_read(void)
                if (lat == 0 && lon == 0)       /* skip records with no GPS data */
                        continue;
 
-               wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+               wpt_tmp = (waypoint *) xcalloc(sizeof(*wpt_tmp), 1);
 
                if (stealth) {
                        if (!snmac)
@@ -244,7 +244,7 @@ fix_netstumbler_dupes(void)
        unsigned long last_crc;
        char ssid[32 + 5 + 1];
 
-       htable = xmalloc(ct * sizeof *htable);
+       htable = (htable_t *) xmalloc(ct * sizeof *htable);
        bh = htable;
 
        i = 0;
index 3835f7de0dbc66400e4bd6e331b91bf0fd5c4571..4d9e2075298a58394f3825991aecd20ebc5ac0c8 100644 (file)
@@ -217,13 +217,13 @@ polygon_process(void)
 
                waypointp = (waypoint *)elem;
                if ( waypointp->extra_data ) {
-                   ed = waypointp->extra_data;
+                   ed = (extra_data *) waypointp->extra_data;
                }
                else {
-                   ed = xcalloc(1, sizeof(*ed));
+                   ed = (extra_data *) xcalloc(1, sizeof(*ed));
                    ed->state = OUTSIDE;
                    ed->override = 0;
-                   waypointp->extra_data = ed;
+                   waypointp->extra_data = (extra_data *) ed;
                }
                if ( lat2 == waypointp->latitude && 
                     lon2 == waypointp->longitude ) {
@@ -266,7 +266,7 @@ polygon_process(void)
 
        QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
                waypoint *wp = (waypoint *) elem;
-               ed = wp->extra_data;
+               ed = (extra_data *) wp->extra_data;
                wp->extra_data = NULL;
                if ( ed ) {
                    if ( ed->override ) ed->state = INSIDE;
index e5273ed2e3f8a71c3f3bbcbd0d754b8d7ea5b0ab..fc436d6eee97b27bb311f467dfce5179b7b21f73 100644 (file)
@@ -109,8 +109,8 @@ dist_comp(const void * a, const void * b)
 {
        const waypoint *x1 = *(waypoint **)a;
        const waypoint *x2 = *(waypoint **)b;
-       extra_data *x1e = x1->extra_data;
-       extra_data *x2e = x2->extra_data;
+       extra_data *x1e = (extra_data *) x1->extra_data;
+       extra_data *x2e = (extra_data *) x2->extra_data;
 
        if (x1e->distance > x2e->distance)
                return 1;
@@ -131,7 +131,7 @@ position_process(void)
 
        wc = waypt_count();
 
-       comp = xcalloc(wc, sizeof(*comp));
+       comp = (waypoint **) xcalloc(wc, sizeof(*comp));
 
        i = 0;
 
@@ -219,7 +219,7 @@ radius_process(void)
                        continue;
                }
 
-               ed = xcalloc(1, sizeof(*ed));
+               ed = (extra_data *) xcalloc(1, sizeof(*ed));
                ed->distance = dist;
                waypointp->extra_data = ed;
        }
@@ -227,7 +227,7 @@ radius_process(void)
        wc = waypt_count();
        QUEUE_INIT(&temp_head);
 
-       comp = xcalloc(wc, sizeof(*comp));
+       comp = (waypoint **) xcalloc(wc, sizeof(*comp));
 
        i = 0;
 
@@ -277,7 +277,7 @@ radius_init(const char *args) {
                }
        }
 
-       home_pos = xcalloc(sizeof(*home_pos), 1);
+       home_pos = (waypoint *) xcalloc(sizeof(*home_pos), 1);
 
        if (latopt)
                home_pos->latitude = atof(latopt);
index ee24fa3f7888e2e48b6da9ffca21caa9161b0518..4015e008d05d9fc713db8f5aab76f6f69a8cb148 100644 (file)
@@ -67,7 +67,7 @@ routesimple_waypt_pr( const waypoint *wpt )
 {
        if ( !cur_rte ) return;
        xte_recs[xte_count].ordinal=xte_count;
-       xte_recs[xte_count].intermed = xmalloc( sizeof(struct xte_intermed));
+       xte_recs[xte_count].intermed = (xte_intermed *) xmalloc( sizeof(struct xte_intermed));
        xte_recs[xte_count].intermed->wpt = wpt;
        xte_recs[xte_count].intermed->xte_rec = xte_recs+xte_count;
        xte_recs[xte_count].intermed->next = NULL;
@@ -125,7 +125,7 @@ routesimple_head( const route_head *rte )
        /* short-circuit if we already have fewer than the max points */
        if ( count >= rte->rte_waypt_ct) return;
        
-       xte_recs = xcalloc(  rte->rte_waypt_ct, sizeof (struct xte));
+       xte_recs = (xte *) xcalloc(  rte->rte_waypt_ct, sizeof (struct xte));
        cur_rte = rte;
        
 }
index f84529a54935884fab223f4ece84a279aa414f6e..446688ea319384c61b01ffbae53be63123a7c0c4 100644 (file)
@@ -63,7 +63,7 @@ sort_process(void)
 
        wc = waypt_count();
 
-       comp = xcalloc(wc, sizeof(*comp));
+       comp = (waypoint **) xcalloc(wc, sizeof(*comp));
 
        QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
                comp[i] = (waypoint *)elem;
index 116dd53a3420913e2ce5bac991cbf2ce3b9205d2..3ffb50efaa8e9ce2cd2a07aa260bab2f88677ac2 100644 (file)
@@ -211,11 +211,11 @@ xcsv_parse_style_line(const char *sbuff)
 
                /* field delimiters are always bad characters */
                if (xcsv_file.badchars) {
-                       xcsv_file.badchars = xrealloc(xcsv_file.badchars,
+                       xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
                                strlen(xcsv_file.badchars) +
                                strlen(p) + 1);
                } else {
-                       xcsv_file.badchars = xcalloc(strlen(p) + 1, 1);
+                       xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
                }
 
                strcat(xcsv_file.badchars, p);
@@ -238,11 +238,11 @@ xcsv_parse_style_line(const char *sbuff)
 
                /* record delimiters are always bad characters */
                if (xcsv_file.badchars) {
-                       xcsv_file.badchars = xrealloc(xcsv_file.badchars,
+                       xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
                                strlen(xcsv_file.badchars) +
                                strlen(p) + 1);
                } else {
-                       xcsv_file.badchars = xcalloc(strlen(p) + 1, 1);
+                       xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
                }
 
                strcat(xcsv_file.badchars, p);
@@ -295,11 +295,11 @@ xcsv_parse_style_line(const char *sbuff)
                p = sp;
                
                if (xcsv_file.badchars) {
-                       xcsv_file.badchars = xrealloc(xcsv_file.badchars,
+                       xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
                                strlen(xcsv_file.badchars) +
                                strlen(p) + 1);
                } else {
-                       xcsv_file.badchars = xcalloc(strlen(p) + 1, 1);
+                       xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
                }
 
                strcat(xcsv_file.badchars, p);